package cn.ivicar.mapper.service;

import java.util.List;

import cn.ivicar.mapper.ibatis.model.BaseExample;
import cn.ivicar.mapper.model.BaseDataObject;
import org.apache.ibatis.session.SqlSessionFactory;

public interface CRUDManager<T extends BaseDataObject, K> {
    public BaseExample getExample();

    public T get(K parameter);

    public T get(K parameter, boolean replicable);

    public List<T> list();

    public List<T> list(boolean replicable);

    public List<T> listByExample(T example);

    public List<T> listByExample(T example, boolean replicable);

    public List<T> listByBaseExample(BaseExample example);

    public List<T> listByBaseExample(BaseExample example, boolean replicable);

    public List<T> listByBaseExampleWithBLOBs(BaseExample example);

    public List<T> listByBaseExampleWithBLOBs(BaseExample example, boolean replicable);

    public int countByExample(BaseExample example);

    public int countByExample(BaseExample example, boolean replicable);

    public int insert(T object);

    public int update(T object);

    public int updateSelective(T object);

    public int delete(T object);

    public int deleteByPrimaryKey(K id);

    public int logicalDelete(T object);

    public int logicalRecover(T object);

    public int updateByBaseExampleSelective(T record, BaseExample example);

    public int updateByBaseExample(T record, BaseExample example);

    public SqlSessionFactory getSqlSessionFactory();

    public int deleteByBaseExample(BaseExample example);
}
